package com.shop.admin.validate.question;

import com.shop.common.entity.QuestionOption;
import com.shop.common.validator.annotation.IDMust;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 试题参数
 * @author DragonDean
 */
@Data
@ApiModel("试题更新参数")
public class QuestionUpdateValidate implements Serializable {

    private static final long serialVersionUID = 1L;

    @IDMust(message = "id参数必传且需大于0")
    @ApiModelProperty(value = "ID")
    private Integer id;

    @NotNull(message = "type参数缺失")
    @ApiModelProperty(value = "类型")
    private Integer type;

    @NotNull(message = "categoryId参数缺失")
    @ApiModelProperty(value = "分类ID")
    private Integer categoryId;

    @NotNull(message = "title参数缺失")
    @ApiModelProperty(value = "题干")
    private String title;

    @ApiModelProperty(value = "选项")
    @Valid
    private List<QuestionOption> options;

    @ApiModelProperty(value = "解释")
    private String explanation;

    @ApiModelProperty(value = "关键词")
    private String keywords;

}
